<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=no">
	<title>提交领奖信息</title>
	<link rel="stylesheet" type="text/css" href="/addons/stonefish_luckynum/template/images/index.css" media="all">
<script>var require = { urlArgs: 'v={php echo date('YmdH');}' };</script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="{$_W['siteroot']}app/resource/js/require.js"></script>
<script src="{$_W['siteroot']}app/resource/js/app/config.js"></script>
<script type="text/javascript">
	// jssdk config 对象
	jssdkconfig = {php echo json_encode($_W['account']['jssdkconfig']);} || {};
	// 是否启用调试
	jssdkconfig.debug = false;
	
	jssdkconfig.jsApiList = [
		'checkJsApi',
		'hideOptionMenu',
		'closeWindow'
	];

	wx.config(jssdkconfig);
	require(['jquery', 'util'], function($, util){
		wx.ready(function () {
			wx.hideOptionMenu();
			{if $success}
			    alert('您的兑奖信息已提交，请等待工作人员联系您！');
				wx.closeWindow();
		    {/if}
		});
	});
</script>
</head>
<body id="wrap">
	<div class="cardexplain">
		<form method="post" action="" id="form" onsubmit="return check_submit(this)">
			<input type="hidden" name="token" value="{$_W['token']}" />
			<input type="hidden" name="from" value="{$from}" />
			<ul class="round">
				<li class="title mb"><span class="none">{$reply['ticketinfo']}</span></li>
				{if $reply['isrealname']}
				<li class="nob">
					<table class="kuang" border="0" cellpadding="0" cellspacing="0" width="100%">
						<tbody>
							<tr>
								<th>{$isfansname[0]}</th>
								<td>
									<input class="px" placeholder="请输入{$isfansname[0]}" id="realname" name="realname" value="{$profile['realname']}" type="text" maxLength="20" required/>
								</td>
							</tr>
						</tbody>
					</table>
				</li>
				{/if}
				{if $reply['ismobile']}
				<li class="nob">
					<table class="kuang" border="0" cellpadding="0" cellspacing="0" width="100%">
						<tbody>
							<tr>
								<th>{$isfansname[1]}</th>
								<td>
									<input class="px" placeholder="请输入{$isfansname[1]}" id="mobile" name="mobile" value="{$profile['mobile']}" type="text" maxLength="20" pattern="[0-9]{11}"/>
								</td>
							</tr>
						</tbody>
					</table>
				</li>
				{/if}
				{if $reply['isqq']}
				<li class="nob">
					<table class="kuang" border="0" cellpadding="0" cellspacing="0" width="100%">
						<tbody>
							<tr>
							<th>{$isfansname[2]}</th>
								<td>
									<input class="px" placeholder="请输入{$isfansname[2]}" id="qq" name="qq" value="{$profile['qq']}" type="text" pattern="[0-9]{5,15}" maxLength="15" required>
								</td>
							</tr>
						</tbody>
					</table>
				</li>
				{/if}
				{if $reply['isemail']}
				<li class="nob">
					<table class="kuang" border="0" cellpadding="0" cellspacing="0" width="100%">
						<tbody>
							<tr>
								<th>{$isfansname[3]}</th>
								<td>
									<input class="px" placeholder="请输入{$isfansname[3]}" id="email" name="email" value="{$profile['email']}" type="text"/>
								</td>
							</tr>
						</tbody>
					</table>
				</li>
				{/if}
				{if $reply['isaddress']}
				<li class="nob">
					<table class="kuang" border="0" cellpadding="0" cellspacing="0" width="100%">
						<tbody>
							<tr>
								<th>{$isfansname[4]}</th>
								<td>
									<input class="px" placeholder="请输入{$isfansname[4]}" id="address" name="address" value="{$profile['address']}" type="text"/>
								</td>
							</tr>
						</tbody>
					</table>
				</li>
				{/if}
				{if $reply['isgender']}
				<li class="nob">
					<table class="kuang" border="0" cellpadding="0" cellspacing="0" width="100%">
						<tbody>
							<tr>
								<th>{$isfansname[5]}</th>
								<td>
									<select name="gender" id="gender" class="form-control">
									<option value="0"{if $profile['gender']==0} selected {/if}>选择{$isfansname[5]}</option>
									<option value="1"{if $profile['gender']==1} selected {/if}>男</option>
									<option value="2"{if $profile['gender']==2} selected {/if}>女</option>
									</select>
								</td>
							</tr>
						</tbody>
					</table>
				</li>
				{/if}
				{if $reply['istelephone']}
				<li class="nob">
					<table class="kuang" border="0" cellpadding="0" cellspacing="0" width="100%">
						<tbody>
							<tr>
								<th>{$isfansname[6]}</th>
								<td>
									<input class="px" placeholder="请输入{$isfansname[6]}" id="telephone" name="telephone" value="{$profile['telephone']}" type="text"/>
								</td>
							</tr>
						</tbody>
					</table>
				</li>
				{/if}
				{if $reply['isidcard']}
				<li class="nob">
					<table class="kuang" border="0" cellpadding="0" cellspacing="0" width="100%">
						<tbody>
							<tr>
								<th>{$isfansname[7]}</th>
								<td>
									<input class="px" placeholder="请输入{$isfansname[7]}" id="idcard" name="idcard" value="{$profile['idcard']}" type="text"/>
								</td>
							</tr>
						</tbody>
					</table>
				</li>
				{/if}
				{if $reply['iscompany']}
				<li class="nob">
					<table class="kuang" border="0" cellpadding="0" cellspacing="0" width="100%">
						<tbody>
							<tr>
								<th>{$isfansname[8]}</th>
								<td>
									<input class="px" placeholder="请输入{$isfansname[8]}" id="company" name="company" value="{$profile['company']}" type="text"/>
								</td>
							</tr>
						</tbody>
					</table>
				</li>
				{/if}
				{if $reply['isoccupation']}
				<li class="nob">
					<table class="kuang" border="0" cellpadding="0" cellspacing="0" width="100%">
						<tbody>
							<tr>
								<th>{$isfansname[9]}</th>
								<td>
									<input class="px" placeholder="请输入{$isfansname[9]}" id="occupation" name="occupation" value="{$profile['occupation']}" type="text"/>
								</td>
							</tr>
						</tbody>
					</table>
				</li>
				{/if}
				{if $reply['isposition']}
				<li class="nob">
					<table class="kuang" border="0" cellpadding="0" cellspacing="0" width="100%">
						<tbody>
							<tr>
								<th>{$isfansname[10]}</th>
								<td>
									<input class="px" placeholder="请输入{$isfansname[10]}" id="position" name="position" value="{$profile['position']}" type="text"/>
								</td>
							</tr>
						</tbody>
					</table>
				</li>
				{/if}
			</ul>
			<div class="footReturn" style="text-align: center;">
				<input style="margin: 0px auto 20px; width: 90%;" class="submit" value="提交" name="submit" type="submit">
			</div>
		</form>
	</div>
<script>
	function check_submit(form)
	{
		   {if $reply['isrealname']}
			var realname = $("#realname").val();
            if (realname == '') {
				$("#result_info_tip").text("请输入{$isfansname[0]}");
                return
            }
			var partten = /[\u4e00-\u9fa5]/g;
            if(!partten.test(realname)){
               $("#result_info_tip").text("请输入正确的{$isfansname[0]}");
			   return;
            }
			{/if}
			{if $reply['ismobile']}
			var mobile = $("#mobile").val();
            if (mobile == '') {
                $("#result_info_tip").text("请输入{$isfansname[1]}");
                return
            }
			var partten = /^1\d{10}$/;
            if(!partten.test(mobile)){
               $("#result_info_tip").text("请输入正确的{$isfansname[1]}");
			   return;
            }
			{/if}
			{if $reply['isqq']}
			var qq = $("#qq").val();
            if (qq == '') {
                $("#result_info_tip").text("请输入{$isfansname[2]}");
                return
            }			
            var partten = /^[1-9]{1}\d{4,11}$/;
            if(!partten.test(qq)){
               $("#result_info_tip").text("请输入正确的{$isfansname[2]}");
			   return;
            }
			{/if}
			{if $reply['isemail']}
			var email = $("#email").val();
            if (email == '') {
                $("#result_info_tip").text("请输入{$isfansname[3]}");
                return
            }
			var partten = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
            if(!partten.test(email)){
               $("#result_info_tip").text("请输入正确的{$isfansname[3]}");
			   return;
            }
			{/if}
			{if $reply['isaddress']}
			var address = $("#address").val();
            if (address == '') {
                $("#result_info_tip").text("请输入{$isfansname[4]}");
                return
            }
			{/if}
			{if $reply['isgender']}
			var gender = $("#gender").val();
            if (gender == '0') {
                $("#result_info_tip").text("请选择{$isfansname[5]}");
                return
            }
			{/if}
			{if $reply['istelephone']}
			var telephone = $("#telephone").val();
            if (telephone == '') {
                $("#result_info_tip").text("请输入{$isfansname[6]}");
                return
            }
			{/if}
			{if $reply['isidcard']}
			var idcard = $("#idcard").val();
            if (idcard == '') {
                $("#result_info_tip").text("请输入{$isfansname[7]}");
                return
            }
			{/if}
			{if $reply['iscompany']}
			var company = $("#company").val();
            if (company == '') {
                $("#result_info_tip").text("请输入{$isfansname[8]}");
                return
            }
			{/if}
			{if $reply['isoccupation']}
			var occupation = $("#occupation").val();
            if (occupation == '') {
                $("#result_info_tip").text("请输入{$isfansname[9]}");
                return
            }
			{/if}
			{if $reply['isposition']}
			var position = $("#position").val();
            if (position == '') {
                $("#result_info_tip").text("请输入{$isfansname[10]}");
                return
            }
			{/if}
		return true;
	}
</script>
</body>
</html>
